import time
from selenium import webdriver
class Worsends:
    def __init__(self):
        self.driver = None
    # 打开浏览器
    def open_llq(self,llq = 'Edge'):
        llq = llq.lower()
        if llq == 'edge':
            self.driver = webdriver.Edge()
        elif llq == 'Chrome':
            self.driver = webdriver.Chrome()
        elif llq == 'firefox':
            self.driver = webdriver.Firefox()
        self.driver.maximize_window()
    # 打开网址
    def open_url(self,url):
        self.driver.get(url)
    # 点击
    def click(self,loc):
        ele = self.driver.find_element(*loc)
        ele.click()
    # 输入
    def send_keys(self,loc):
        ele = self.driver.find_element(*loc)
        ele.send_keys()
    # 等待
    def sellp(self,loc):
        time.sleep(int(loc))
    # 关闭浏览器
    def clear(self):
        if self.driver:
            self.driver.quit()